package main.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import de.gugubarra.core.nop.Topic;

public class Centroid {

	private Map<Topic, Double> topicWeightMap;

	public Map<Topic, Double> getTopicWeightMap() {
		return topicWeightMap;
	}

	public void setTopicWeightMap(Map<Topic, Double> topicWeightMap) {
		if (this.topicWeightMap == null) {
			this.topicWeightMap = new HashMap<Topic, Double>();
		}
		Set<Topic> keys = topicWeightMap.keySet();
		ArrayList<Topic> tList = new ArrayList<Topic>(keys);
		for (int i = 0; i < tList.size(); i++) {
			Topic aTopic = tList.get(i);
			Double weight = topicWeightMap.get(aTopic);
			this.topicWeightMap.put(aTopic, weight);
		}
	}
}